#include <cstdio>
#include <memory.h>
#include <algorithm>
#include <vector>

#define pow2(x) ((x)*(x))
using namespace std;

int S[10005];
vector<int> v;

int main() {
	int m, n, wi, maxw = -1;
	scanf("%d", &m);
	for (int ui = 1; ui <= m; ++ui) {
		printf("Case #%d:\n", ui);
		scanf("%d", &n);
		if (n == 1) {
			scanf("%d", &wi);
			printf("%d\n", (10000 - pow2(100 - wi)));
			continue;
		}
		for (int i = 1; i <= n; ++i) {
			scanf("%d", &wi);
			int now = 10000 - pow2(100 - wi);
			++S[now];
			maxw = max(now, maxw);
		}

		int nowmax = -1, tn = 0;
		for (int i = 0; i <= maxw; ++i) {
			if (S[i]) ++tn;
			if (nowmax < S[i]) {
				v.clear();
				v.push_back(i);
				nowmax = S[i];
			} else if (nowmax == S[i]) {
				v.push_back(i);
			}
		}
		if (v.size() == tn) {
			printf("Bad Mushroom\n");
		} else {
			for (int i = 0; i < v.size(); ++i) {
				printf("%d ", v[i]);
			}
			printf("\n");
		}
		memset(S, 0, sizeof(S));
		maxw = -1;
		v.clear();
	}
	return 0;
}